package com.mobile.persistent.dao;

import java.util.List;

import org.springframework.stereotype.Repository;

import com.mobile.persistent.base.BaseDao;
import com.mobile.persistent.entity.UserPurview;

@Repository
@SuppressWarnings("unchecked")
public class UserPurviewDao extends BaseDao<UserPurview, Long> {

	
	/**
	 * 获取用户的操作权限
	 * @param uid 用户id
	 * @return 用户操作权限列表
	 */
	public List<UserPurview> getPurviewsByUid(Long uid){
		String hql = "from UserPurview up where up.user.id = ?";
		return createQuery(hql, uid).list();
	}
}
